|
|
|
| Table 3.2 Static Colors | SYSTEM PALETTE
INDEX | VISUAL BASIC
CONSTANT | VALUE | COLOR | |  |
|
|
|
|
vbBlack |
|
|
|
| &H0 | Black | | | &H80 | Dark red | | | &H8000 | Dark green | | | &H8080 | Dark yellow | | | &H800000 | Dark blue | | | &H800080 | Dark magenta | | | &H808000 | Dark cyan | | | &HC0C0C0 | Light gray | | | &HC0DCC0 | Money green | | | &HF0CAA6 | Sky blue | | | &HF0FBFF | Cream | | | &HA4A0A0 | Medium gray | | | &H808080 | Dark gray | |  |
|
|
|
|
vbRed |
|
|
|
| &HFF | Red | |  |
|
|
|
|
vbGreen |
|
|
|
| &HFF00 | Green | |  |
|
|
|
|
vbYellow |
|
|
|
| &HFFFF | Yellow | |  |
|
|
|
|
vbBlue |
|
|
|
| &HFF0000 | Blue | |  |
|
|
|
|
vbMagenta |
|
|
|
| &HFF00FF | Magenta | |  |
|
|
|
|
vbCyan |
|
|
|
| &HFFFF00 | Cyan | |  |
|
|
|
|
vbWhite |
|
|
|
| &HFFFFFF | White |
|
|
|
|
|
|
is 250, or &HFA in hexadecimal. If you invert the bits in the value &HFA, you get &H05. If you subtract 250 from 255, you get 5, the same value. |
|
|
|
|
|
|
|
|
Because the inverted value for 250 is 5, if you draw in invert mode on a form with a green (system palette entry 250) background, you produce the color at position 5 in the system color palette, which is dark magenta. |
|
|
|
|
|
|
|
|
The static colors are arranged so that inverting one of them produces a color that contrasts sharply with the original color. Green is a very bright color, and dark magenta is a very dark color. As you can see from the list, inverted values of bright colors are dark colors and vice versa. As a result, when you draw in invert mode, the results should be visible, no matter how cluttered the screen is. |
|
|
|
|
|
|
|
|
On the other hand, the system cannot guarantee that the inverted value of a non-static color will contrast well with the original color. For instance, the system palette may happen to contain the color &HD0FFD0 (pale green) in entry 10 and the almost identi- |
|
|
|
|
|